package com.ourteam.product.requirement.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-11 15:23:40 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductCatalogBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.requirement.dao.ProductCatalog productCatalog;

  protected BeanMap getBeanMap() {

    return new BeanMap(productCatalog);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.requirement.dao.IProductCatalogDAO.Id);

    mappedDaoFields.put("name", com.ourteam.product.requirement.dao.IProductCatalogDAO.CatalogName);

    mappedDaoFields.put(
        "parentId", com.ourteam.product.requirement.dao.IProductCatalogDAO.ParentId);

    mappedDaoFields.put("remarks", com.ourteam.product.requirement.dao.IProductCatalogDAO.Remarks);

    mappedDaoFields.put("sort", com.ourteam.product.requirement.dao.IProductCatalogDAO.SortIndex);

    mappedDaoFields.put("status", com.ourteam.product.requirement.dao.IProductCatalogDAO.Status);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductCatalogBean() {
    super();

    this.productCatalog = new com.ourteam.product.requirement.dao.ProductCatalog();
  }

  public ProductCatalogBean(com.ourteam.product.requirement.dao.ProductCatalog productCatalog) {
    super();

    this.productCatalog = productCatalog;
  }

  public com.ourteam.product.requirement.dao.ProductCatalog convertToProductCatalog() {
    return this.productCatalog;
  }

  public com.ourteam.product.requirement.dao.ProductCatalog convertTo() {
    return this.productCatalog;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productCatalog.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productCatalog.setId(id);
  }

  /**
   * Get name
   *
   * @return String
   */
  public String getName() {
    return (String) this.productCatalog.getCatalogName();
  }

  /**
   * Set name
   *
   * @parameter String
   */
  public void setName(String name) {

    this.productCatalog.setCatalogName(name);
  }

  /**
   * Get parentId
   *
   * @return long
   */
  public long getParentId() {
    return (long) this.productCatalog.getParentId();
  }

  /**
   * Set parentId
   *
   * @parameter long
   */
  public void setParentId(long parentId) {

    this.productCatalog.setParentId(parentId);
  }

  /**
   * Get remarks
   *
   * @return String
   */
  public String getRemarks() {
    return (String) this.productCatalog.getRemarks();
  }

  /**
   * Set remarks
   *
   * @parameter String
   */
  public void setRemarks(String remarks) {

    this.productCatalog.setRemarks(remarks);
  }

  /**
   * Get sort
   *
   * @return int
   */
  public int getSort() {
    return (int) this.productCatalog.getSortIndex();
  }

  /**
   * Set sort
   *
   * @parameter int
   */
  public void setSort(int sort) {

    this.productCatalog.setSortIndex(sort);
  }

  /**
   * Get status
   *
   * @return String
   */
  public String getStatus() {
    return (String) this.productCatalog.getStatus();
  }

  /**
   * Set status
   *
   * @parameter String
   */
  public void setStatus(String status) {

    this.productCatalog.setStatus(status);
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductCatalogBean) == false) {
      return false;
    } // end if

    ProductCatalogBean other = (ProductCatalogBean) obj;

    boolean isEqual = false;

    com.ourteam.product.requirement.dao.ProductCatalog tempProductCatalog =
        other.convertToProductCatalog();

    if (tempProductCatalog == null || this.productCatalog == null) {
      isEqual = false;
    } else if (tempProductCatalog == this.productCatalog
        || tempProductCatalog.equals(this.productCatalog)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductCatalogBean[] toArray(
      com.ourteam.product.requirement.dao.ProductCatalog[] aProductCatalogs) {

    return toArray(aProductCatalogs, null);
  }

  public static ProductCatalogBean[] toArray(
      com.ourteam.product.requirement.dao.ProductCatalog[] aProductCatalogs,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductCatalogs)) {
      return new ProductCatalogBean[0];
    }

    int length = aProductCatalogs.length;

    ProductCatalogBean[] beans = new ProductCatalogBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductCatalogBean(aProductCatalogs[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductCatalogs[i]});
      }
    }

    return beans;
  }
}
